﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using Medianamik.Globalization;
using System.Web.UI.WebControls;

namespace Medianamik.Core.Synchronization
{
    [DebuggerDisplay("{Name} : {Id}")]
    [CLSCompliant(false)]
    public class RecordTypeProperty
    {
        public Guid Id { get; set; }
        public Guid DataTypeId { get; set; }
        public string Name { get; set; }

        public string GroupName
        {
            get { return _groupName; }
            set { _groupName = value; }
        }
        string _groupName = "Content";

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }
        string _description = "";

        public bool HasTooltip { get; set; }
        public bool IsIndexable { get; set; }
        public bool IsLanguageNeutral { get; set; }
        public bool IsRequired { get; set; }
        public bool ValueMustBeUnique { get; set; }
        public short? MaxLength { get; set; }
        public short? MinLength { get; set; }
        public Guid? MedianamikControlId { get; set; }
        public string MedianamikControlWidth { get; set; }
        public int? MedianamikControlHeight { get; set; }
        public Translation LocalizedNames { get; set; }
        public int Flags { get; set; }

        //Devrait inclure un message d'erreur (validation)
        //Devrait être une collection éventuellement
        public string RegexValidation { get; set; }

        public bool IsLookup { get; set; }
        public bool IsManyToMany { get { return _isManyToMany; } set { _isManyToMany = value; } }
        private bool _isManyToMany = false;

        public Guid? PrimaryTypeId { get; set; }
        public Guid? PrimaryPropertyId { get; set; }
        public Guid? RootNodeId { get; set; }

        //Permet-on d'importer la sécurité ?
        public IEnumerable<String> Roles { get; set; }
    }
}